import React from 'react'
import { HashRouter as Router, Route, Switch, Redirect} from 'react-router-dom';
import Login from './pages/Login';
import App from './App';
import Nav from './components/Nav/Nav'
import PublishArticle from '@/pages/article/PublishArticle'
import NOFOUND from '@/pages/404.jsx'
import RenderRoutesMap from '@/components/Route/RenderRoute'
import routes from '@/routes/routes'

export default () => (
    <Router>
        <Switch>
            <Redirect exact from="/" to="/app" />
            <Route  path="/publishArticle"  component={PublishArticle} />
            {RenderRoutesMap(routes)}
            <Redirect to="/404" />
        </Switch>
    </Router>
)